"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var io = require("socket.io");
var SocketIoService = /** @class */ (function () {
    function SocketIoService() {
        this.io = io();
        this.io.on('connection', function (socket) { });
    }
    return SocketIoService;
}());
exports.SocketIoService = SocketIoService;
var Socket = /** @class */ (function () {
    function Socket(socket) {
        var _this = this;
        this.socket = socket;
        this.emit$.subscribe(function (res) {
            _this.socket.emit(res.event, res.data);
        });
    }
    Socket.prototype.on = function (type) {
        var _this = this;
        this.socket.on(type, function (data) {
            _this.on$.next(data);
        });
    };
    return Socket;
}());
exports.Socket = Socket;
